<?php

/**
 * MyStock form base class.
 *
 * @package    stock
 * @subpackage form
 * @author     Your name here
 */
class BaseMyStockForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'name'             => new sfWidgetFormInput(),
      'code'             => new sfWidgetFormInput(),
      'current'          => new sfWidgetFormInput(),
      'kaipan'           => new sfWidgetFormInput(),
      'shoupan'          => new sfWidgetFormInput(),
      'highest'          => new sfWidgetFormInput(),
      'lowest'           => new sfWidgetFormInput(),
      'buy_price'        => new sfWidgetFormInput(),
      'sell_price'       => new sfWidgetFormInput(),
      'turnover_count'   => new sfWidgetFormInput(),
      'turnover_value'   => new sfWidgetFormInput(),
      'buy1_count'       => new sfWidgetFormInput(),
      'buy1_price'       => new sfWidgetFormInput(),
      'buy2_count'       => new sfWidgetFormInput(),
      'buy2_price'       => new sfWidgetFormInput(),
      'buy3_count'       => new sfWidgetFormInput(),
      'buy3_price'       => new sfWidgetFormInput(),
      'buy4_count'       => new sfWidgetFormInput(),
      'buy4_price'       => new sfWidgetFormInput(),
      'buy5_count'       => new sfWidgetFormInput(),
      'buy5_price'       => new sfWidgetFormInput(),
      'sell1_count'      => new sfWidgetFormInput(),
      'sell1_price'      => new sfWidgetFormInput(),
      'sell2_count'      => new sfWidgetFormInput(),
      'sell2_price'      => new sfWidgetFormInput(),
      'sell3_count'      => new sfWidgetFormInput(),
      'sell3_price'      => new sfWidgetFormInput(),
      'sell4_count'      => new sfWidgetFormInput(),
      'sell4_price'      => new sfWidgetFormInput(),
      'sell5_count'      => new sfWidgetFormInput(),
      'sell5_price'      => new sfWidgetFormInput(),
      'increase'         => new sfWidgetFormInput(),
      'increase_percent' => new sfWidgetFormInput(),
      'date'             => new sfWidgetFormDate(),
      'time'             => new sfWidgetFormTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'MyStock', 'column' => 'id', 'required' => false)),
      'name'             => new sfValidatorString(array('max_length' => 50)),
      'code'             => new sfValidatorString(array('max_length' => 50)),
      'current'          => new sfValidatorNumber(),
      'kaipan'           => new sfValidatorNumber(),
      'shoupan'          => new sfValidatorNumber(),
      'highest'          => new sfValidatorNumber(),
      'lowest'           => new sfValidatorNumber(),
      'buy_price'        => new sfValidatorNumber(),
      'sell_price'       => new sfValidatorNumber(),
      'turnover_count'   => new sfValidatorInteger(),
      'turnover_value'   => new sfValidatorNumber(),
      'buy1_count'       => new sfValidatorInteger(),
      'buy1_price'       => new sfValidatorNumber(),
      'buy2_count'       => new sfValidatorInteger(),
      'buy2_price'       => new sfValidatorNumber(),
      'buy3_count'       => new sfValidatorInteger(),
      'buy3_price'       => new sfValidatorNumber(),
      'buy4_count'       => new sfValidatorInteger(),
      'buy4_price'       => new sfValidatorNumber(),
      'buy5_count'       => new sfValidatorInteger(),
      'buy5_price'       => new sfValidatorNumber(),
      'sell1_count'      => new sfValidatorInteger(),
      'sell1_price'      => new sfValidatorNumber(),
      'sell2_count'      => new sfValidatorInteger(),
      'sell2_price'      => new sfValidatorNumber(),
      'sell3_count'      => new sfValidatorInteger(),
      'sell3_price'      => new sfValidatorNumber(),
      'sell4_count'      => new sfValidatorInteger(),
      'sell4_price'      => new sfValidatorNumber(),
      'sell5_count'      => new sfValidatorInteger(),
      'sell5_price'      => new sfValidatorNumber(),
      'increase'         => new sfValidatorNumber(),
      'increase_percent' => new sfValidatorNumber(),
      'date'             => new sfValidatorDate(),
      'time'             => new sfValidatorTime(),
    ));

    $this->widgetSchema->setNameFormat('my_stock[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'MyStock';
  }


}
